package com.jy.func.scroll;



import com.jy.func.R;
import com.jy.func.R.layout;
import com.jy.func.R.string;

import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

public class ScreenSlidePageFragment extends Fragment{

	private int mPageNumber;
	public static final String ARG_PAGE = "page";
	
    public static ScreenSlidePageFragment create(int pageNumber) {
        ScreenSlidePageFragment fragment = new ScreenSlidePageFragment();
        Bundle args = new Bundle();
        args.putInt(ARG_PAGE, pageNumber);
        fragment.setArguments(args);
        return fragment;
    }
	 
    public ScreenSlidePageFragment() {
    }

    
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mPageNumber = getArguments().getInt(ARG_PAGE);
    }
    
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        ViewGroup rootView = (ViewGroup) inflater.inflate(
                R.layout.fragment_screen_slide_page, container, false);
        
     // Set the title view to show the page number.
        ((TextView) rootView.findViewById(R.id.text1)).setText(
                getString(R.string.title_template_step, mPageNumber + 1));
        
        switch (mPageNumber) {
		case 0:
		{
			rootView.setBackgroundColor(Color.parseColor("#FFD39B"));
		}
			break;
		case 1:
		{
			rootView.setBackgroundColor(Color.parseColor("#EEE685"));
		}
			break;
		case 2:
		{
			rootView.setBackgroundColor(Color.parseColor("#B4EEB4"));
		}
			break;
		case 3:
		{
			rootView.setBackgroundColor(Color.parseColor("#71C671"));
		}
			break;
		case 4:
		{
			rootView.setBackgroundColor(Color.parseColor("#D8BFD8"));
		}
			break;
		case 5:
		{
			rootView.setBackgroundColor(Color.parseColor("#FA8072"));
		}
			break;
		default:
			rootView.setBackgroundColor(Color.parseColor("#FA8072"));
			break;
		}
        
        return rootView;
    }
    
}
